<!DOCTYPE html>
<html lang='en'>

<head>
    <meta charset='UTF-8'>
    <meta name='viewport' content='width=device-width, initial-scale=1.0'>
    <title>Document</title>
    <script type='text/javascript' src='js/vue.js'></script>
</head>

<body>
    <div id='app'>
        {{msg}}
        =====
        <father :title='msg' :title2='msg2'></father>
    </div>
    <script type='text/javascript'>
        var son = {
            props:['q1'],
            template: `
            <p>我是son组件=={{ss}}==={{q1}}</p>
            `,
            data() {
                return {
                    ss: '我是son'
                }
            }
        }

        var father = {
            props:['title','title2'],
            template: `
                <h1>我是father组件=={{ff}}===={{title}}==={{title2}}
                <son :q1='f2'></son>
                </h1>
            `,
            components: {
                son: son
            },
            data() {
                return {
                    ff: 'Hello Vue',
                    f2:'我是father中的数据'
                }
            }
        }

        var vm = new Vue({
            el: '#app',
            data: {
                msg: '我是实例对象 app上的数据',
                msg2:'我是实例对象 app上的第二个数据'
            },
            components: {
                father: father
            }
        });
    </script>
</body>

</html>